let app = getApp()
Component({
    properties: {
 
      },
      data:{
        page:1,
        siteDomain:app.globalData.siteDomain
      },
    lifetimes: {
        attached: function () {
           this.get_data()
           this.setData({
            integral:wx.getStorageSync('userinfo').integral,
            globalColor:app.globalData.globalColor
           })
       }
      },
    methods: {
      pointsdetails:function(){
        wx.navigateTo({
          url: '/yb_shopv2/native/all/index?type=pointsdetails',
        })
      },
      exchangeRecords:function(){
        wx.navigateTo({
          url: '/yb_shopv2/native/all/index?type=exchangerecord',
        })
      },
      goodsdetail:function(e){
        wx.navigateTo({
          url: '/yb_shopv2/native/all/index?type=good_detail&goods_id='+e.currentTarget.dataset.id+"&activity=integral",
        })
      },
      get_data:function(){
        var that=this
         wx.request({
           url: app.globalData.siteroot,
           data: { 
             do:'Integralmall_getIntegralGoodsList',
             is_recommend:0,
             page:that.data.page,
             staff_id:wx.getStorageSync('staff_bind_id')
           },
           success: function(res) {
              that.setData({
                goodsInfo:res.data.data
              })
           }
         })
        }
    }
});
